package cn.tedu.course.subject.controller;

import cn.tedu.course.base.response.JsonResult;
import cn.tedu.course.subject.pojo.dot.SubjectQuery;
import cn.tedu.course.subject.pojo.entity.Subject;
import cn.tedu.course.subject.pojo.vo.SubjectVo;
import cn.tedu.course.subject.service.SubjectService;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.v3.oas.annotations.Operation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/subject/")
public class SubjectController {
    @Autowired
    SubjectService subjectService;

    @Operation(summary = "查询列表")
    @RequestMapping("select")
    @ApiOperationSupport(order = 10)
    public JsonResult selectSubject(SubjectQuery subjectQuery){
        log.debug("查询科目列表"+ subjectQuery);
        List<SubjectVo> list = subjectService.selectSubject(subjectQuery);
        return JsonResult.ok(list);
    }
}
